################################################################################
# Code for analyses from paper:
# The Political Legacy of Forced Migration - Evidence from post-WWII Germany
################################################################################
# Clearing the workspace and loading the requisite libraries
rm(list=ls()); library(foreign); library(car); library(lmtest) 
library(multiwayvcov); library(stargazer); library(corrplot); 
library(gridExtra); library(reghelper); library(ei) 
library(lmtest); library(ivpack); library(clubSandwich); options(warn = -1)
library(maps) ; library(mapdata); library(MASS); library(spdep) 
library(lubridate) ; library(rgdal) ; library(raster) ; library(rgl) 
library(plotrix); library(effectsize); library(estimatr); library(boot)
library(CBPS); library(MatchIt); library(cobalt); library(WeightIt) 
################################################################################
# Details on R and R-package versions used in analyses:

## sessionInfo()
# R version 4.1.0 (2021-05-18)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 10 x64 (build 22621)

## Packages
# WeightIt_0.12.0     
# cobalt_4.3.2        
# CBPS_0.23           
# glmnet_4.1-1        
# Matrix_1.3-3       
# numDeriv_2016.8-1.1 
# nnet_7.3-16         
# MatchIt_4.4.0       
# boot_1.3-28         
# estimatr_0.30.2    
# effectsize_0.7.0.5  
# plotrix_3.8-1       
# rgl_0.106.8         
# raster_3.4-10       
# rgdal_1.5-23       
# lubridate_1.7.10    
# spdep_1.1-8         
# sf_0.9-8            
# spData_0.3.8        
# sp_1.4-5           
# MASS_7.3-54         
# mapdata_2.3.0       
# maps_3.3.0          
# clubSandwich_0.5.3  
# ivpack_1.2         
# AER_1.2-9           
# survival_3.2-11     
# sandwich_3.0-1      
# ei_1.3-3            
# eiPack_0.2-1       
# reghelper_1.1.1     
# gridExtra_2.3       
# corrplot_0.89       
# stargazer_5.2.2     
# multiwayvcov_1.2.3 
# lmtest_0.9-38       
# zoo_1.8-9           
# car_3.0-10          
# carData_3.0-4       
# foreign_0.8-81     
# readxl_1.3.1            
# backports_1.2.1         
# gmm_1.6-6               
# splines_4.1.0          
# crosstalk_1.1.1         
# ggplot2_3.3.3           
# TH.data_1.0-10          
# digest_0.6.27          
# foreach_1.5.1           
# htmltools_0.5.1.1       
# gdata_2.18.0            
# fansi_0.5.0            
# magrittr_2.0.1          
# openxlsx_4.2.3          
# extrafont_0.18          
# gmodels_2.18.1         
# extrafontdb_1.0         
# colorspace_2.0-1        
# haven_2.4.1             
# xfun_0.23              
# dplyr_1.0.7             
# crayon_1.4.1            
# jsonlite_1.7.2          
# iterators_1.0.13       
# glue_1.4.2              
# gtable_0.3.0            
# emmeans_1.6.2-1         
# Rttf2pt1_1.3.10        
# shape_1.4.6             
# abind_1.4-5             
# scales_1.1.1            
# mvtnorm_1.1-3          
# DBI_1.1.1               
# miniUI_0.1.1.1          
# Rcpp_1.0.8.3            
# xtable_1.8-4           
# tmvnsim_1.0-2           
# units_0.7-1             
# proxy_0.4-25            
# Formula_1.2-4          
# stats4_4.1.0            
# datawizard_0.6.1        
# htmlwidgets_1.5.3       
# ellipsis_0.3.2         
# pkgconfig_2.0.3         
# deldir_0.2-10           
# utf8_1.2.1              
# tidyselect_1.1.1       
# rlang_0.4.11            
# manipulateWidget_0.11.0 
# later_1.2.0             
# munsell_0.5.0          
# cellranger_1.1.0        
# tools_4.1.0             
# generics_0.1.0          
# fastmap_1.1.0          
# knitr_1.33              
# zip_2.2.0               
# purrr_0.3.4             
# nlme_3.1-152           
# mime_0.10               
# compiler_4.1.0          
# curl_4.3.1              
# e1071_1.7-7            
# tibble_3.1.2            
# stringi_1.6.1           
# parameters_0.18.2       
# forcats_0.5.1          
# cubature_2.0.4.2        
# lattice_0.20-44         
# classInt_0.4-3          
# psych_2.1.3            
# tmvtnorm_1.4-10         
# vctrs_0.3.8             
# msm_1.6.8               
# pillar_1.6.1           
# LearnBayes_2.15.1       
# lifecycle_1.0.0         
# ucminf_1.1-4            
# estimability_1.3       
# data.table_1.14.0       
# insight_0.18.4          
# httpuv_1.6.1            
# R6_2.5.0               
# promises_1.2.0.1        
# KernSmooth_2.23-20      
# rio_0.5.26              
# codetools_0.2-18       
# gtools_3.9.2            
# assertthat_0.2.1        
# mnormt_2.0.2            
# multcomp_1.4-17        
# bayestestR_0.13.0       
# expm_0.999-6            
# parallel_4.1.0          
# hms_1.1.0              
# grid_4.1.0              
# coda_0.19-4             
# class_7.3-19            
# shiny_1.6.0            
# ellipse_0.4.2          
################################################################################

paths <- c("[insert file path here]")

setwd(paths[[1]])
load("replication_data.RData")
################################################################################
################################################################################
## Main paper
################################################################################
################################################################################

################################################################################
# Table 1: No code required
################################################################################

################################################################################
# Figure 1: Distribution of expellees across West Germany
################################################################################

CS <- function(colors, values) {
  v <- (values - min(values))/diff(range(values))
  vp <- car::recode(v, "0:.2 = .1 ; .21:.4 = .3 ; .41:.6 = .5 ; .61:.8 = .7 ; .81:1 = .9")
  x <- colorRamp(colors)(vp)
  rgb(x[,1], x[,2], x[,3], maxColorValue = 255)
}

germany <- shapefile("Germany_1949.shp")

germany$lander <- substr(germany$Kreis_ID, 1,2)
WG49 <- subset(germany, germany$lander < 10)

mapping_data <-  merge(WG49,data,by = 'Kreis_ID', all.x = F)

mapping_data$greyscl <- car::recode(mapping_data$exp50, "0:.09999999 = 'grey90'; 
                                    0.1:.19999999 = 'grey70';
                                    0.2:.29999999 = 'grey50'; 
                                    0.3:.39999999 = 'grey30'; 
                                    0.4:.49999999 = 'grey0'")

raster::plot(mapping_data, col= mapping_data$greyscl)
legend("right",legend = c("< 10%", "10% -- 19.99%", "20% -- 29.99%", "30% -- 39.99%","40% +"),
       fill = unique(sort(mapping_data$greyscl,decreasing = T)), 
       title = "Expellees as percentage of population",bty = "n")
legend("right",legend = c("< 10%", "10% -- 19.99%", "20% -- 29.99%", "30% -- 39.99%","40% +"),
       fill = unique(sort(mapping_data$greyscl,decreasing = T)), 
       title = "Expellees as percentage of population",bty = "n")

rm(germany,mapping_data,WG49,CS)

################################################################################
# Table 2: Main model 1953 - 1961
################################################################################

DE16 <- shapefile("Germany_1949.shp")
DE16$lander <- substr(DE16$Kreis_ID, 1,2)

WG16 <- subset(DE16, DE16$lander != "10" & DE16$lander != "11" &
                 DE16$lander != "12" & DE16$lander != "13" &
                 DE16$lander != "14" & DE16$lander != "15" & 
                 DE16$lander != "16" & DE16$Kreis_ID != "11BERWES2" & 
                 DE16$Kreis_ID != "05SELFKA0")

nb <- poly2nb(WG16)
nbl <- nb2listw(nb, style="W")

## Key to variables
###################
# exp50 - Expellee share of population in 1950
# lander - German state in which kreis is located
# az - Allied oocupation zone in which kreis was located
# hdam - Housing damage
# mrooms - mean rooms per house
# pd39 - log(population density 1939)
# exp_dist - log(cumulative distance to expulsion regions)
# NSDAP33 - Nazi party vote share in the March 1933 election
# pr50 - Protestant share of population in 1950
# rc50 - Catholic share of population in 1950
# j50 - Jewish share of population in 1950

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL53 <- lm(paste('BHE53', paste(c(controls), collapse="+"), sep="~"), data = data)
EL57 <- lm(paste('BHE57', paste(c(controls), collapse="+"), sep="~"), data = data)
EL61 <- lm(paste('GDP61', paste(c(controls), collapse="+"), sep="~"), data = data)

ES53 <- reghelper::beta(EL53); ES57 <- reghelper::beta(EL57); ES61 <- reghelper::beta(EL61)

MI53 <- lm.morantest(EL53, nbl, alternative = "two.sided")
MI57 <- lm.morantest(EL57, nbl, alternative = "two.sided")
MI61 <- lm.morantest(EL61, nbl, alternative = "two.sided")

stargazer(EL53,EL57,EL61,
          se = starprep(EL53,EL57,EL61, clusters = data$lander, se_type = "stata"),
          p = starprep(EL53,EL57,EL61, clusters = data$lander, stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", round(ES53$coefficients[2,1],2),
                             round(ES57$coefficients[2,1],2),
                             round(ES61$coefficients[2,1],2)),
                           c("Moran's-I two-sided p", round(MI53[[2]],2), round(MI57[[2]],2), round(MI61[[2]],2)),
                           c("Covariates","YES","YES","YES"),
                           c("State Fixed Effect","YES","YES","YES"),
                           c("Allied Power Fixed Effect","YES","YES","YES")),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = "",
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1953}","\\textbf{1957}","\\textbf{1961}"),
          column.labels = c("\\textbf{BHE}","\\textbf{BHE}","\\textbf{GDP}"),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(DE16,EL53,EL57,EL61,ES53,ES57,ES61,MI53,MI57,MI61,nb,nbl,WG16)

################################################################################
# Figure 2: Main model 1969 - 2019 
################################################################################

years <- c(1953,1957,1961,1969,1972,1976,1983,1984,1987,1989,1990,1994,1994,1998,1999,
           2002,2004,2005,2009,2009,2013,2014,2017,2019)

m53 <- lm_robust(BHE53 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m57 <- lm_robust(BHE57 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m61 <- lm_robust(GDP61 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m69 <- lm_robust(RR_E69 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m72 <- lm_robust(RR_E72 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m76 <- lm_robust(RR_E76 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m83 <- lm_robust(RR_E83 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m84 <- lm_robust(RR_E84 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m87 <- lm_robust(RR_E87 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m89 <- lm_robust(RR_E89 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m90 <- lm_robust(RR_E90 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m94a <- lm_robust(RR_E94a ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                    NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m94b <- lm_robust(RR_E94b ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                    NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m98 <- lm_robust(RR_E98 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m99 <- lm_robust(RR_E99 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m02 <- lm_robust(RR_E02 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m04 <- lm_robust(RR_E04 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m05 <- lm_robust(RR_E05 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m09a <- lm_robust(RR_E09a ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                    NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m09b <- lm_robust(RR_E09b ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                    NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m13 <- lm_robust(RR_E13 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m14 <- lm_robust(RR_E14 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m17 <- lm_robust(RR_E17 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

m19 <- lm_robust(RR_E19 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist +
                   NSDAP33 + pr50 + rc50 + j50, se_type = "stata", clusters = data$lander, data)

## Note on warning produced:
## The allied zone = "UK" coefficient is dropped as the state fixed effect captures it completely.
## The "US" and "FR" zones do not perfectly overlap with states.
## Furthermore, the results are qualitatively unchanged by the exclusion of 
## the Allied Zone fixed effect ("az").

sb53 <- standardize_parameters(m53)
sb57 <- standardize_parameters(m57)
sb61 <- standardize_parameters(m61)
sb69 <- standardize_parameters(m69)
sb72 <- standardize_parameters(m72)
sb76 <- standardize_parameters(m76)
sb83 <- standardize_parameters(m83)
sb84 <- standardize_parameters(m84)
sb87 <- standardize_parameters(m87)
sb89 <- standardize_parameters(m89)
sb90 <- standardize_parameters(m90)
sb94a <- standardize_parameters(m94a)
sb94b <- standardize_parameters(m94b)
sb98 <- standardize_parameters(m98)
sb99 <- standardize_parameters(m99)
sb02 <- standardize_parameters(m02)
sb04 <- standardize_parameters(m04)
sb05 <- standardize_parameters(m05)
sb09a <- standardize_parameters(m09a)
sb09b <- standardize_parameters(m09b)
sb13 <- standardize_parameters(m13)
sb14 <- standardize_parameters(m14)
sb17 <- standardize_parameters(m17)
sb19 <- standardize_parameters(m19)

sb <- round(c(sb53$Std_Coefficient[2],sb57$Std_Coefficient[2],sb61$Std_Coefficient[2],
              sb69$Std_Coefficient[2],sb72$Std_Coefficient[2],sb76$Std_Coefficient[2],
              sb83$Std_Coefficient[2],sb84$Std_Coefficient[2],sb87$Std_Coefficient[2],
              sb89$Std_Coefficient[2],sb90$Std_Coefficient[2],sb94a$Std_Coefficient[2],
              sb94b$Std_Coefficient[2],sb98$Std_Coefficient[2],sb99$Std_Coefficient[2],
              sb02$Std_Coefficient[2],sb04$Std_Coefficient[2],sb05$Std_Coefficient[2],
              sb09a$Std_Coefficient[2],sb09b$Std_Coefficient[2],sb13$Std_Coefficient[2],
              sb14$Std_Coefficient[2],sb17$Std_Coefficient[2],sb19$Std_Coefficient[2]),2)

ciu <- round(c(sb53$CI_high[2],sb57$CI_high[2],sb61$CI_high[2],
               sb69$CI_high[2],sb72$CI_high[2],sb76$CI_high[2],
               sb83$CI_high[2],sb84$CI_high[2],sb87$CI_high[2],
               sb89$CI_high[2],sb90$CI_high[2],sb94a$CI_high[2],
               sb94b$CI_high[2],sb98$CI_high[2],sb99$CI_high[2],
               sb02$CI_high[2],sb04$CI_high[2],sb05$CI_high[2],
               sb09a$CI_high[2],sb09b$CI_high[2],sb13$CI_high[2],
               sb14$CI_high[2],sb17$CI_high[2],sb19$CI_high[2]),2)

cil <- round(c(sb53$CI_low[2],sb57$CI_low[2],sb61$CI_low[2],
               sb69$CI_low[2],sb72$CI_low[2],sb76$CI_low[2],
               sb83$CI_low[2],sb84$CI_low[2],sb87$CI_low[2],
               sb89$CI_low[2],sb90$CI_low[2],sb94a$CI_low[2],
               sb94b$CI_low[2],sb98$CI_low[2],sb99$CI_low[2],
               sb02$CI_low[2],sb04$CI_low[2],sb05$CI_low[2],
               sb09a$CI_low[2],sb09b$CI_low[2],sb13$CI_low[2],
               sb14$CI_low[2],sb17$CI_low[2],sb19$CI_low[2]),2)

ss <- c(1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1) 

ylabel <- "Standardized coefficients"

par(mar=c(2,6,1,1)+.1)

plot(years,sb, xlab= "", ylab = ylabel,
     type="b",col="red", frame.plot=FALSE, pch=21, 
     bg = ss,xlim=c(1950,2020), ylim = c(-.3,1),
     panel.first = rect(c(1950,1980,2010), -1e6, c(1965,2000,2020), 1e6, 
                        col='gray87', border=NA))
ablineclip(h = 0,x1=1950,x2=2020,col="black",lwd = 1, lty = 2)
text(1990, .7, expression('Relationship only expected within shaded regions'))

plotCI(years, sb, ui= ciu, li=cil, add = T)

rm(m53,m57,m61,m69,m72,m76,m83,m84,m87,m89,m90,m94a,m94b,m98,m99,m02,m04,m05,
   m09a,m09b,m13,m14,m17,m19,sb53,sb57,sb61,sb69,sb72,sb76,sb83,sb84,sb87,sb89,
   sb90,sb94a,sb94b,sb98,sb99,sb02,sb04,sb05,sb09a,sb09b,sb13,sb14,sb17,sb19,
   cil,ciu,controls,sb,ss,years,ylabel)

################################################################################
# Figure 3: Ecological Inference 
################################################################################

attach(data)

z1 <- hdam; z2 <- pd39; z3 <- exp_dist
z4 <- lander; z5 <- az; z6 <- mrooms
z7 <- pr50; z8 <- rc50; z9 <- j50; z10 <- NSDAP33

covs <- as.matrix(cbind.data.frame(z1,z2,z3,z4,z5,z6,z7,z8,z9,z10))

## evoters = eligible voters in each kreis as per election data

t <- BHE53; x <- exp50; n <- evoters53
data <- cbind.data.frame(t,x,n)
E53 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- BHE57; x <- exp50; n <- evoters57
data <- cbind.data.frame(t,x,n)
E57 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- GDP61; x <- exp60; n <- evoters61
data <- cbind.data.frame(t,x,n)
E61 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E69; x <- exp60; n <- evoters69
data <- cbind.data.frame(t,x,n)
E69 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E72; x <- exp60; n <- evoters72
data <- cbind.data.frame(t,x,n)
E72 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E76; x <- exp60; n <- evoters76
data <- cbind.data.frame(t,x,n)
E76 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E83; x <- exp60; n <- evoters83
data <- cbind.data.frame(t,x,n)
E83 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E84; x <- exp60; n <- evoters84
data <- cbind.data.frame(t,x,n)
E84 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E87; x <- exp60; n <- evoters87
data <- cbind.data.frame(t,x,n)
E87 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E89; x <- exp60; n <- evoters89
data <- cbind.data.frame(t,x,n)
E89 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E90; x <- exp60; n <- evoters90
data <- cbind.data.frame(t,x,n)
E90 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E94a; x <- exp60; n <- evoters94a
data <- cbind.data.frame(t,x,n)
E94a <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E94b; x <- exp60; n <- evoters94b
data <- cbind.data.frame(t,x,n)
E94b <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E98; x <- exp60; n <- evoters98
data <- cbind.data.frame(t,x,n)
E98 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E99; x <- exp60; n <- evoters99
data <- cbind.data.frame(t,x,n)
E99 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E02; x <- exp60; n <- evoters02
data <- cbind.data.frame(t,x,n)
E02 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E04; x <- exp60; n <- evoters04
data <- cbind.data.frame(t,x,n)
E04 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E05; x <- exp60; n <- evoters05
data <- cbind.data.frame(t,x,n)
E05 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E09a; x <- exp60; n <- evoters09a
data <- cbind.data.frame(t,x,n)
E09a <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E09b; x <- exp60; n <- evoters09b
data <- cbind.data.frame(t,x,n)
E09b <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E13; x <- exp60; n <- evoters13
data <- cbind.data.frame(t,x,n)
E13 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E14; x <- exp60; n <- evoters14
data <- cbind.data.frame(t,x,n)
E14 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E17; x <- exp60; n <- evoters17
data <- cbind.data.frame(t,x,n)
E17 <- ei(t ~ x, data = data, total = "n", covariate = covs)

t <- RR_E19; x <- exp60; n <- evoters19
data <- cbind.data.frame(t,x,n)
E19 <- ei(t ~ x, data = data, total = "n", covariate = covs)

explist  <- c(mean(E53$betab),mean(E57$betab),mean(E61$betab),mean(E69$betab),mean(E72$betab),mean(E76$betab),
              mean(E83$betab),mean(E84$betab),mean(E87$betab),mean(E89$betab),mean(E90$betab),mean(E94a$betab),
              mean(E94b$betab),mean(E98$betab),mean(E99$betab),mean(E02$betab),mean(E04$betab),mean(E05$betab),
              mean(E09a$betab),mean(E09b$betab),mean(E13$betab),mean(E14$betab),mean(E17$betab),mean(E19$betab))

nexplist  <- c(mean(E53$betaw),mean(E57$betaw),mean(E61$betaw),mean(E69$betaw),mean(E72$betaw),mean(E76$betaw),
               mean(E83$betaw),mean(E84$betaw),mean(E87$betaw),mean(E89$betaw),mean(E90$betaw),mean(E94a$betaw),
               mean(E94b$betaw),mean(E98$betaw),mean(E99$betaw),mean(E02$betaw),mean(E04$betaw),mean(E05$betaw),
               mean(E09a$betaw),mean(E09b$betaw),mean(E13$betaw),mean(E14$betaw),mean(E17$betaw),mean(E19$betaw))

years <- c(1953,1957,1961,1969,1972,1976,1983,1984,1987,1989,1990,1994,1994,1998,1999,
           2002,2004,2005,2009,2009,2013,2014,2017,2019)

par(mfrow=c(1,1))

eu <- c(rep(1,24))

## Calculating confidence intervals for the mean for both sub-populations 
## from the EI estimates for each unit of analysis for each year

exp_upper <- c(mean(E53$betab) + 1.96*(mean(E53$sbetab)/sqrt(556)),
               mean(E57$betab) + 1.96*(mean(E57$sbetab)/sqrt(556)),
               mean(E61$betab) + 1.96*(mean(E61$sbetab)/sqrt(556)),
               mean(E69$betab) + 1.96*(mean(E69$sbetab)/sqrt(556)),
               mean(E72$betab) + 1.96*(mean(E72$sbetab)/sqrt(556)),
               mean(E76$betab) + 1.96*(mean(E76$sbetab)/sqrt(556)),
               mean(E83$betab) + 1.96*(mean(E83$sbetab)/sqrt(556)),
               mean(E84$betab) + 1.96*(mean(E84$sbetab)/sqrt(556)),
               mean(E87$betab) + 1.96*(mean(E87$sbetab)/sqrt(556)),
               mean(E89$betab) + 1.96*(mean(E89$sbetab)/sqrt(556)),
               mean(E90$betab) + 1.96*(mean(E90$sbetab)/sqrt(556)),
               mean(E94a$betab) + 1.96*(mean(E94a$sbetab)/sqrt(556)),
               mean(E94b$betab) + 1.96*(mean(E94b$sbetab)/sqrt(556)),
               mean(E98$betab) + 1.96*(mean(E98$sbetab)/sqrt(556)),
               mean(E99$betab) + 1.96*(mean(E99$sbetab)/sqrt(556)),
               mean(E02$betab) + 1.96*(mean(E02$sbetab)/sqrt(556)),
               mean(E04$betab) + 1.96*(mean(E04$sbetab)/sqrt(556)),
               mean(E05$betab) + 1.96*(mean(E05$sbetab)/sqrt(556)),
               mean(E09a$betab) + 1.96*(mean(E09a$sbetab)/sqrt(556)),
               mean(E09b$betab) + 1.96*(mean(E09b$sbetab)/sqrt(556)),
               mean(E13$betab) + 1.96*(mean(E13$sbetab)/sqrt(556)),
               mean(E14$betab) + 1.96*(mean(E14$sbetab)/sqrt(556)),
               mean(E17$betab) + 1.96*(mean(E17$sbetab)/sqrt(556)),
               mean(E19$betab) + 1.96*(mean(E19$sbetab)/sqrt(556)))

exp_lower <- c(mean(E53$betab) - 1.96*(mean(E53$sbetab)/sqrt(556)),
               mean(E57$betab) - 1.96*(mean(E57$sbetab)/sqrt(556)),
               mean(E61$betab) - 1.96*(mean(E61$sbetab)/sqrt(556)),
               mean(E69$betab) - 1.96*(mean(E69$sbetab)/sqrt(556)),
               mean(E72$betab) - 1.96*(mean(E72$sbetab)/sqrt(556)),
               mean(E76$betab) - 1.96*(mean(E76$sbetab)/sqrt(556)),
               mean(E83$betab) - 1.96*(mean(E83$sbetab)/sqrt(556)),
               mean(E84$betab) - 1.96*(mean(E84$sbetab)/sqrt(556)),
               mean(E87$betab) - 1.96*(mean(E87$sbetab)/sqrt(556)),
               mean(E89$betab) - 1.96*(mean(E89$sbetab)/sqrt(556)),
               mean(E90$betab) - 1.96*(mean(E90$sbetab)/sqrt(556)),
               mean(E94a$betab) - 1.96*(mean(E94a$sbetab)/sqrt(556)),
               mean(E94b$betab) - 1.96*(mean(E94b$sbetab)/sqrt(556)),
               mean(E98$betab) - 1.96*(mean(E98$sbetab)/sqrt(556)),
               mean(E99$betab) - 1.96*(mean(E99$sbetab)/sqrt(556)),
               mean(E02$betab) - 1.96*(mean(E02$sbetab)/sqrt(556)),
               mean(E04$betab) - 1.96*(mean(E04$sbetab)/sqrt(556)),
               mean(E05$betab) - 1.96*(mean(E05$sbetab)/sqrt(556)),
               mean(E09a$betab) - 1.96*(mean(E09a$sbetab)/sqrt(556)),
               mean(E09b$betab) - 1.96*(mean(E09b$sbetab)/sqrt(556)),
               mean(E13$betab) - 1.96*(mean(E13$sbetab)/sqrt(556)),
               mean(E14$betab) - 1.96*(mean(E14$sbetab)/sqrt(556)),
               mean(E17$betab) - 1.96*(mean(E17$sbetab)/sqrt(556)),
               mean(E19$betab) - 1.96*(mean(E19$sbetab)/sqrt(556)))

nexp_upper <- c(mean(E53$betaw) + 1.96*(mean(E53$sbetaw)/sqrt(556)),
                mean(E57$betaw) + 1.96*(mean(E57$sbetaw)/sqrt(556)),
                mean(E61$betaw) + 1.96*(mean(E61$sbetaw)/sqrt(556)),
                mean(E69$betaw) + 1.96*(mean(E69$sbetaw)/sqrt(556)),
                mean(E72$betaw) + 1.96*(mean(E72$sbetaw)/sqrt(556)),
                mean(E76$betaw) + 1.96*(mean(E76$sbetaw)/sqrt(556)),
                mean(E83$betaw) + 1.96*(mean(E83$sbetaw)/sqrt(556)),
                mean(E84$betaw) + 1.96*(mean(E84$sbetaw)/sqrt(556)),
                mean(E87$betaw) + 1.96*(mean(E87$sbetaw)/sqrt(556)),
                mean(E89$betaw) + 1.96*(mean(E89$sbetaw)/sqrt(556)),
                mean(E90$betaw) + 1.96*(mean(E90$sbetaw)/sqrt(556)),
                mean(E94a$betaw) + 1.96*(mean(E94a$sbetaw)/sqrt(556)),
                mean(E94b$betaw) + 1.96*(mean(E94b$sbetaw)/sqrt(556)),
                mean(E98$betaw) + 1.96*(mean(E98$sbetaw)/sqrt(556)),
                mean(E99$betaw) + 1.96*(mean(E99$sbetaw)/sqrt(556)),
                mean(E02$betaw) + 1.96*(mean(E02$sbetaw)/sqrt(556)),
                mean(E04$betaw) + 1.96*(mean(E04$sbetaw)/sqrt(556)),
                mean(E05$betaw) + 1.96*(mean(E05$sbetaw)/sqrt(556)),
                mean(E09a$betaw) + 1.96*(mean(E09a$sbetaw)/sqrt(556)),
                mean(E09b$betaw) + 1.96*(mean(E09b$sbetaw)/sqrt(556)),
                mean(E13$betaw) + 1.96*(mean(E13$sbetaw)/sqrt(556)),
                mean(E14$betaw) + 1.96*(mean(E14$sbetaw)/sqrt(556)),
                mean(E17$betaw) + 1.96*(mean(E17$sbetaw)/sqrt(556)),
                mean(E19$betaw) + 1.96*(mean(E19$sbetaw)/sqrt(556)))

nexp_lower <- c(mean(E53$betaw) - 1.96*(mean(E53$sbetaw)/sqrt(556)),
                mean(E57$betaw) - 1.96*(mean(E57$sbetaw)/sqrt(556)),
                mean(E61$betaw) - 1.96*(mean(E61$sbetaw)/sqrt(556)),
                mean(E69$betaw) - 1.96*(mean(E69$sbetaw)/sqrt(556)),
                mean(E72$betaw) - 1.96*(mean(E72$sbetaw)/sqrt(556)),
                mean(E76$betaw) - 1.96*(mean(E76$sbetaw)/sqrt(556)),
                mean(E83$betaw) - 1.96*(mean(E83$sbetaw)/sqrt(556)),
                mean(E84$betaw) - 1.96*(mean(E84$sbetaw)/sqrt(556)),
                mean(E87$betaw) - 1.96*(mean(E87$sbetaw)/sqrt(556)),
                mean(E89$betaw) - 1.96*(mean(E89$sbetaw)/sqrt(556)),
                mean(E90$betaw) - 1.96*(mean(E90$sbetaw)/sqrt(556)),
                mean(E94a$betaw) - 1.96*(mean(E94a$sbetaw)/sqrt(556)),
                mean(E94b$betaw) - 1.96*(mean(E94b$sbetaw)/sqrt(556)),
                mean(E98$betaw) - 1.96*(mean(E98$sbetaw)/sqrt(556)),
                mean(E99$betaw) - 1.96*(mean(E99$sbetaw)/sqrt(556)),
                mean(E02$betaw) - 1.96*(mean(E02$sbetaw)/sqrt(556)),
                mean(E04$betaw) - 1.96*(mean(E04$sbetaw)/sqrt(556)),
                mean(E05$betaw) - 1.96*(mean(E05$sbetaw)/sqrt(556)),
                mean(E09a$betaw) - 1.96*(mean(E09a$sbetaw)/sqrt(556)),
                mean(E09b$betaw) - 1.96*(mean(E09b$sbetaw)/sqrt(556)),
                mean(E13$betaw) - 1.96*(mean(E13$sbetaw)/sqrt(556)),
                mean(E14$betaw) - 1.96*(mean(E14$sbetaw)/sqrt(556)),
                mean(E17$betaw) - 1.96*(mean(E17$sbetaw)/sqrt(556)),
                mean(E19$betaw) - 1.96*(mean(E19$sbetaw)/sqrt(556)))

op <- par(cex = 1.15)
par(mar=c(5,6,4,1)+.1)
plot(years,nexplist, xlab= "", 
     ylab= "Estimated proportion of subgroup \n supporting the radical right",  
     type="b",col="black", frame.plot=FALSE, pch=24, bg = "grey",xlim=c(1950,2020), 
     ylim = c(0,.5), lty = 3,
     panel.first = rect(c(1950,1980,2010), -1e6, c(1965,2000,2020), 1e6, 
                        col='gray87', border=NA))
lines(years,explist,col="red", type = "b",pch=21,bg = eu)
ablineclip(h = 0,x1=1950,x2=2020,col="black",lwd = 1, lty = 2)
legend("topright", legend=c("Expellees", "Non-expellees"), 
       text.font = 3,col= c("red","black"), lty= c(1,3), 
       pch= c(NA,NA,19), cex= 0.8,bty="n",y.intersp = 2)

plotCI(years, nexplist, ui= nexp_upper, li=nexp_lower, add = T)
plotCI(years, explist, ui= exp_upper, li=exp_lower, add = T)

text(1980, .45, expression('Difference between subgroups only expected within shaded regions'))

detach(data)

rm(eu,exp_lower,exp_upper,explist,n,nexp_lower,nexp_upper,nexplist,t,x,years,z1,
   z2,z3,z4,z5,z6,z7,z8,z9,z10,covs,E53,E57,E61,E69,E72,E76,E83,E84,E87,E89,E90,
   E94a,E94b,E98,E99,E02,E04,E05,E09a,E09b,E13,E14,E17,E19,op)

################################################################################
################################################################################
## Online Appendix
################################################################################
################################################################################

################################################################################
# Table A1: Additional control - Proportion of population that is Jewish in 1925
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50", "j25")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table A2: Additional control - Proportion of population that is Jewish in 1939
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50", "j39")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table A3: Additional control - Change in proportion Jewish from 1925 to 1939
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50", "jd1")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table A4: Additional control - Change in proportion Jewish from 1939 to 1945
################################################################################

## Data on religious makeup of kreis are missing for some kreis in 1946
data2 <- subset(data,is.na(data$jd2) != T)

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50", "jd2")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data2)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data2$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data2$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data2$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data2$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data2$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data2$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,data2,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table A5: Additional control - Change in proportion Jewish from 1925 to 1945
################################################################################

## Data on religious makeup of kreis are missing for some kreis in 1946
data2 <- subset(data,is.na(data$jd2) != T)

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50", "jd3")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data2)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data2)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data2$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data2$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data2$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data2$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data2$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data2$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,data2,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table B1: Replacing 1949 administrative units with modern units 
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = B1data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = B1data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = B1data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = B1data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = B1data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = B1data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = B1data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = B1data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C1: Summary statistics
################################################################################

ewl <- c('DNVP20','DNVP_MAY24','DNVP_DEC24','NSDAP28','NSDAP30','NSDAP_JUL32',
         'NSDAP_NOV32','NSDAP33') 

epwl <- c('BHE53','BHE57','GDP61','RR_E69','RR_E72','RR_E76',
          'RR_E83','RR_E84','RR_E87','RR_E89','RR_E90','RR_E94a',
          'RR_E94b','RR_E98','RR_E99','RR_E02','RR_E04','RR_E05',
          'RR_E09a','RR_E09b','RR_E13','RR_E14','RR_E17','RR_E19')

expl <- c("exp50","exp60","er_exp","vk_exp")

cl <- c("hdam","mrooms","pd39","exp_dist","pr25","pr46","pr50",
        "rc25","rc46","rc50","j25","j39","j46","j50","ccdist")

## Weimar elections
newl <- names(data)[(names(data) %in% ewl)]
SSV_newl <- data[,newl]

colnames(SSV_newl)[1] <- "DNVP -- June 1920"
colnames(SSV_newl)[2] <- "DNVP -- May 1924"
colnames(SSV_newl)[3] <- "DNVP -- Dec 1924"
colnames(SSV_newl)[4] <- "NSDAP -- May 1928"
colnames(SSV_newl)[5] <- "NSDAP -- Sep 1930"
colnames(SSV_newl)[6] <- "NSDAP -- July 1932"
colnames(SSV_newl)[7] <- "NSDAP -- Nov 1932"
colnames(SSV_newl)[8] <- "NSDAP -- Mar 1933"

## Post-Weimar elections
nepwl <- names(data)[(names(data) %in% epwl)]
SSV_nepwl <- data[,nepwl]

colnames(SSV_nepwl)[1] <- "BHE -- 1953"
colnames(SSV_nepwl)[2] <- "BHE -- 1957"
colnames(SSV_nepwl)[3] <- "GDP -- 1961"
colnames(SSV_nepwl)[4] <- "Radical right -- 1969"
colnames(SSV_nepwl)[5] <- "Radical right -- 1972"
colnames(SSV_nepwl)[6] <- "Radical right -- 1976"
colnames(SSV_nepwl)[7] <- "Radical right -- 1983"
colnames(SSV_nepwl)[8] <- "Radical right -- 1984"
colnames(SSV_nepwl)[9] <- "Radical right -- 1987"
colnames(SSV_nepwl)[10] <- "Radical right -- 1989"
colnames(SSV_nepwl)[11] <- "Radical right -- 1990"
colnames(SSV_nepwl)[12] <- "Radical right -- 1994 (F)"
colnames(SSV_nepwl)[13] <- "Radical right -- 1994 (E)"
colnames(SSV_nepwl)[14] <- "Radical right -- 1998"
colnames(SSV_nepwl)[15] <- "Radical right -- 1999"
colnames(SSV_nepwl)[16] <- "Radical right -- 2002"
colnames(SSV_nepwl)[17] <- "Radical right -- 2004"
colnames(SSV_nepwl)[18] <- "Radical right -- 2005"
colnames(SSV_nepwl)[19] <- "Radical right -- 2009 (F)"
colnames(SSV_nepwl)[20] <- "Radical right -- 2009 (E)"
colnames(SSV_nepwl)[21] <- "Radical right -- 2013"
colnames(SSV_nepwl)[22] <- "Radical right -- 2014"
colnames(SSV_nepwl)[23] <- "Radical right -- 2017"
colnames(SSV_nepwl)[24] <- "Radical right -- 2019"

## Expellee variables
nexpl <- names(data)[(names(data) %in% expl)]
SSV_expl <- data[,nexpl]

colnames(SSV_expl)[1] <- "Reichsdeutsche share 1950"
colnames(SSV_expl)[2] <- "Volksdeutsche share 1950"
colnames(SSV_expl)[3] <- "Expellee share 1950"
colnames(SSV_expl)[4] <- "Expellee share 1960"

## Controls
ncl <- names(data)[(names(data) %in% cl)]
SSV_ncl <- data[,ncl]

colnames(SSV_ncl)[1] <- "Proportion housing stock damaged"
colnames(SSV_ncl)[2] <- "Mean rooms per house"
colnames(SSV_ncl)[3] <- "log(Population density 1939)"
colnames(SSV_ncl)[4] <- "log(Expulsion distance)"
colnames(SSV_ncl)[5] <- "log(Distance to nearest concentration camp)"
colnames(SSV_ncl)[6] <- "Percentage Protestant 1925"
colnames(SSV_ncl)[7] <- "Percentage Protestant 1946"
colnames(SSV_ncl)[8] <- "Percentage Protestant 1950"
colnames(SSV_ncl)[9] <- "Percentage Catholic 1925"
colnames(SSV_ncl)[10] <- "Percentage Catholic 1946"
colnames(SSV_ncl)[11] <- "Percentage Catholic 1950"
colnames(SSV_ncl)[12] <- "Percentage Jewish 1925"
colnames(SSV_ncl)[13] <- "Percentage Jewish 1939"
colnames(SSV_ncl)[14] <- "Percentage Jewish 1946"
colnames(SSV_ncl)[15] <- "Percentage Jewish 1950"

SSV <- cbind.data.frame(SSV_newl,SSV_nepwl,SSV_expl,SSV_ncl)

stargazer(SSV)

rm(SSV,SSV_expl,SSV_ncl,SSV_nepwl,SSV_newl,cl,epwl,ewl,expl,ncl,nepwl,newl,nexpl)

################################################################################
# Table C2: Main model 1969 - 2019
################################################################################

DE16 <- shapefile("Germany_1949.shp")
DE16$lander <- substr(DE16$Kreis_ID, 1,2)

WG16 <- subset(DE16, DE16$lander != "10" & DE16$lander != "11" &
                 DE16$lander != "12" & DE16$lander != "13" &
                 DE16$lander != "14" & DE16$lander != "15" & 
                 DE16$lander != "16" & DE16$Kreis_ID != "11BERWES2" & 
                 DE16$Kreis_ID != "05SELFKA0")

nb <- poly2nb(WG16)
nbl <- nb2listw(nb, style="W")

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

MI69 <- lm.morantest(EL69, nbl, alternative = "two.sided")
MI72 <- lm.morantest(EL72, nbl, alternative = "two.sided")
MI76 <- lm.morantest(EL76, nbl, alternative = "two.sided")
MI83 <- lm.morantest(EL83, nbl, alternative = "two.sided")
MI84 <- lm.morantest(EL84, nbl, alternative = "two.sided")
MI87 <- lm.morantest(EL87, nbl, alternative = "two.sided")
MI89 <- lm.morantest(EL89, nbl, alternative = "two.sided")
MI90 <- lm.morantest(EL90, nbl, alternative = "two.sided")
MI94a <- lm.morantest(EL94a, nbl, alternative = "two.sided")
MI94b <- lm.morantest(EL94b, nbl, alternative = "two.sided")
MI98 <- lm.morantest(EL98, nbl, alternative = "two.sided")
MI99 <- lm.morantest(EL99, nbl, alternative = "two.sided")
MI02 <- lm.morantest(EL02, nbl, alternative = "two.sided")
MI04 <- lm.morantest(EL04, nbl, alternative = "two.sided")
MI05 <- lm.morantest(EL05, nbl, alternative = "two.sided")
MI09a <- lm.morantest(EL09a, nbl, alternative = "two.sided")
MI09b <- lm.morantest(EL09b, nbl, alternative = "two.sided")
MI13 <- lm.morantest(EL13, nbl, alternative = "two.sided")
MI14 <- lm.morantest(EL14, nbl, alternative = "two.sided")
MI17 <- lm.morantest(EL17, nbl, alternative = "two.sided")
MI19 <- lm.morantest(EL19, nbl, alternative = "two.sided")

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),
                             round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),
                             round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),
                             round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2)),
                           c("Moran's-I two-sided p", round(MI69[[2]],2), 
                             round(MI72[[2]],2), round(MI76[[2]],2),
                             round(MI83[[2]],2), round(MI84[[2]],2), 
                             round(MI87[[2]],2), round(MI89[[2]],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),
                             round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),
                             round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),
                             round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2)),
                           c("Moran's-I two-sided p", round(MI90[[2]],2), 
                             round(MI94a[[2]],2), round(MI94b[[2]],2),
                             round(MI98[[2]],2), round(MI99[[2]],2), 
                             round(MI02[[2]],2), round(MI04[[2]],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta",
                             round(ES05$coefficients[2,1],2),
                             round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),
                             round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),
                             round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2)),
                           c("Moran's-I two-sided p", round(MI05[[2]],2), 
                             round(MI09a[[2]],2), round(MI09b[[2]],2),
                             round(MI13[[2]],2), round(MI14[[2]],2), 
                             round(MI17[[2]],2), round(MI19[[2]],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,data2,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls,
   MI69,MI72,MI76,MI83,MI84,MI87,MI89,MI90,MI94a,MI94b,MI98,MI99,MI02,MI04,MI05,
   MI09a,MI09b,MI13,MI14,MI17,MI19,DE16,nb,nbl,WG16)

################################################################################
# Table C3: Dependent variable - CDU/CSU vote share
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('CDU_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('CDU_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('CDU_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('CDU_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('CDU_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('CDU_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('CDU_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('CDU_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('CDU_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('CDU_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('CDU_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('CDU_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('CDU_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('CDU_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('CDU_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('CDU_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('CDU_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('CDU_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('CDU_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('CDU_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('CDU_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,data2,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C4: Dependent variable - FDP vote share
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('FDP_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('FDP_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('FDP_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('FDP_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('FDP_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('FDP_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('FDP_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('FDP_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('FDP_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('FDP_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('FDP_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('FDP_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('FDP_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('FDP_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('FDP_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('FDP_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('FDP_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('FDP_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('FDP_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('FDP_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('FDP_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,data2,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C5: Dependent variable - SPD vote share
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('SPD_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('SPD_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('SPD_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('SPD_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('SPD_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('SPD_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('SPD_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('SPD_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('SPD_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('SPD_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('SPD_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('SPD_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('SPD_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('SPD_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('SPD_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('SPD_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('SPD_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('SPD_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('SPD_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('SPD_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('SPD_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,data2,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C6: Dependent variable - GREENS vote share
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL83 <- lm(paste('GREENS_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('GREENS_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('GREENS_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('GREENS_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('GREENS_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('GREENS_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('GREENS_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('GREENS_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('GREENS_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('GREENS_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('GREENS_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('GREENS_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('GREENS_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('GREENS_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('GREENS_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('GREENS_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('GREENS_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('GREENS_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL83,EL84,EL87,EL89, 
          se = starprep(EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES83$coefficients[2,1],2),round(ES84$coefficients[2,1],2),
                             round(ES87$coefficients[2,1],2),round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1983}","\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

rm(EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C7: First-differences model
################################################################################

data$AFD_diff <- data$AFD_E17 - data$AFD_E13

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

FD <- lm(paste('AFD_diff', paste(c(controls), collapse="+"), sep="~"), data = data)

stargazer(FD,
          se = starprep(FD, clusters = data$lander, se_type = "stata"),
          p = starprep(FD, clusters = data$lander, stat = "p.value", se_type = "stata"),
          add.lines = list(c("Covariates","YES"),
                           c("State Fixed Effect","YES"),
                           c("Allied Power Fixed Effect","YES"),
                           c("Election Fixed Effect","YES")),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = "",
          model.numbers = FALSE,
          dep.var.labels = c(""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(FD,controls)

################################################################################
# Table C8: Time-series 
################################################################################

years1 <- rep(c("1953"),556)
years2 <- rep(c("1957"),556)
years3 <- rep(c("1961"),556)
years4 <- rep(c("1969"),556)
years5 <- rep(c("1972"),556)
years6 <- rep(c("1976"),556)
years7 <- rep(c("1983"),556)
years8 <- rep(c("1984"),556)
years9 <- rep(c("1987"),556)
years10 <- rep(c("1989"),556)
years11 <- rep(c("1990"),556)
years12 <- rep(c("1994a"),556)
years13 <- rep(c("1994b"),556)
years14 <- rep(c("1998"),556)
years15 <- rep(c("1999"),556)
years16 <- rep(c("2002"),556)
years17 <- rep(c("2004"),556)
years18 <- rep(c("2005"),556)
years19 <- rep(c("2009a"),556)
years20 <- rep(c("2009b"),556)
years21 <- rep(c("2013"),556)
years22 <- rep(c("2014"),556)
years23 <- rep(c("2017"),556)
years24 <- rep(c("2019"),556)

years <- as.factor(c(years1,years2,years3,years4,years5,years6,years7,years8,
                     years9,years10,years11,years12,years13,years14,years15,years16,
                     years17,years18,years19,years20,years21,years22,years23,years24))

exp50 <- rep(data$exp50,24)
lander <- rep(data$lander,24)
az <- rep(data$az,24)
hdam <- rep(data$hdam,24)
mrooms <- rep(data$mrooms,24)
pd39 <- rep(data$pd39,24)
exp_dist <- rep(data$exp_dist,24)
pr50 <- rep(data$pr50,24)
rc50 <- rep(data$rc50,24)
j50 <- rep(data$j50,24)
NSDAP33 <- rep(data$NSDAP33,24)

RR <- c(data$BHE53,data$BHE57,data$GDP61,data$RR_E69,data$RR_E72,data$RR_E76,
            data$RR_E83,data$RR_E84,data$RR_E87,data$RR_E89,data$RR_E90,data$RR_E94a,
            data$RR_E94b,data$RR_E98,data$RR_E99,data$RR_E02,data$RR_E04,data$RR_E05,
            data$RR_E09a,data$RR_E09b,data$RR_E13,data$RR_E14,data$RR_E17,data$RR_E19)

dat <- cbind.data.frame(RR,exp50,lander,az,hdam,mrooms,pd39,exp_dist,NSDAP33,
                        years,pr50,rc50,j50)

dat2 <- dat[c(1669:13344),]

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "years","NSDAP33","pr50","rc50","j50")

TSI <- lm(paste('RR', paste(c(controls), collapse="+"), sep="~"), data = dat)
TSII <- lm(paste('RR', paste(c(controls), collapse="+"), sep="~"), data = dat2)

TSSI <- reghelper::beta(TSI); TSSII <- reghelper::beta(TSII)

stargazer(TSI,
          se = starprep(TSI, clusters = dat$lander, se_type = "stata"),
          p = starprep(TSI, clusters = dat$lander, stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", round(TSSI$coefficients[2,1],2)),
                           c("Covariates","YES"),
                           c("State Fixed Effect","YES"),
                           c("Allied Power Fixed Effect","YES"),
                           c("Election Fixed Effect","YES")),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = "",
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{All postwar elections}"),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(TSII,
          se = starprep(TSII, clusters = dat2$lander, se_type = "stata"),
          p = starprep(TSII, clusters = dat2$lander, stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", round(TSSII$coefficients[2,1],2)),
                           c("Covariates","YES"),
                           c("State Fixed Effect","YES"),
                           c("Great Power Fixed Effect","YES")),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = "",
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{All non-BHE postwar elections}"),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

################################################################################
# Table C11: Linear Time Trend 
################################################################################

dat$y2 <-  car::recode(dat$years,"'1994a' = 1994;'1994b' = 1994;'2009a' = 2009;'2009b' = 2009")
dat$y3 <- as.numeric(as.character(dat$y2)) - 1950

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "y3","NSDAP33","pr50","rc50","j50","I(exp50*y3)","years")

dat2 <- dat[c(1669:13344),]

LTTI <- lm(paste('RR', paste(c(controls), collapse="+"), sep="~"), data = dat)
LTTII <- lm(paste('RR', paste(c(controls), collapse="+"), sep="~"), data = dat2)

stargazer(LTTI,
          se = starprep(LTTI, clusters = dat$lander, se_type = "stata"),
          p = starprep(LTTI, clusters = dat$lander, stat = "p.value", se_type = "stata"),
          add.lines = list(c("Covariates","YES"),
                           c("State Fixed Effect","YES"),
                           c("Allied Power Fixed Effect","YES"),
                           c("Election Fixed Effect","YES")),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = "",
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{All postwar elections}"),
          keep = c("exp50","y3","exp50*y3"),
          covariate.labels = c("Share of Expellees -- 1950","Linear Time Trend","Share Expellees * Time Trend"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(LTTII,
          se = starprep(LTTII, clusters = dat2$lander, se_type = "stata"),
          p = starprep(LTTII, clusters = dat2$lander, stat = "p.value", se_type = "stata"),
          add.lines = list(c("Covariates","YES"),
                           c("State Fixed Effect","YES"),
                           c("Allied Power Fixed Effect","YES"),
                           c("Election Fixed Effect","YES")),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = "",
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{All non-BHE postwar elections}"),
          keep = c("exp50","y3","exp50*y3"),
          covariate.labels = c("Share of Expellees -- 1950","Linear Time Trend","Share Expellees * Time Trend"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(years1,years2,years3,years4,years5,years6,years7,years8,
   years9,years10,years11,years12,years13,years14,years15,years16,
   years17,years18,years19,years20,years21,years22,years23,years24,years,
   RR,exp50,lander,az,hdam,mrooms,pd39,exp_dist,NSDAP33,pr50,rc50,j50,dat,
   dat2,TSI,TSII,TSSI,TSSII,controls,LTTI,LTTII)

################################################################################
# Table C10: Matching 
################################################################################

set.seed(04162020)

W.out <- weightit(exp50 ~ lander + az + hdam + mrooms + pd39 + exp_dist + 
                    NSDAP33 + pr50 + rc50 + j50,data = data, 
                  method = "npcbgps")

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data, weights = W.out$weights)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,W.out,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C11: Instrumental variable analysis 
################################################################################

## exp46 data is only available for the bizone area (British + American)
data2 <- subset(data, data$az != "FR" & is.na(data$instrument) != T)

iv69 <- ivreg(RR_E69 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv72 <- ivreg(RR_E72 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv76 <- ivreg(RR_E76 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv83 <- ivreg(RR_E83 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv84 <- ivreg(RR_E84 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv87 <- ivreg(RR_E87 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv89 <- ivreg(RR_E89 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv90 <- ivreg(RR_E90 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv94a <- ivreg(RR_E94a ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                 NSDAP33 + pr50 + rc50 + j50|
                 instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                 NSDAP33 + pr50 + rc50 + j50, data = data2)

iv94b <- ivreg(RR_E94b ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                 NSDAP33 + pr50 + rc50 + j50|
                 instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                 NSDAP33 + pr50 + rc50 + j50, data = data2)

iv98 <- ivreg(RR_E98 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv99 <- ivreg(RR_E99 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv02 <- ivreg(RR_E02 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv04 <- ivreg(RR_E04 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv05 <- ivreg(RR_E05 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv09a <- ivreg(RR_E09a ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                 NSDAP33 + pr50 + rc50 + j50|
                 instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                 NSDAP33 + pr50 + rc50 + j50, data = data2)

iv09b <- ivreg(RR_E09b ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                 NSDAP33 + pr50 + rc50 + j50|
                 instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                 NSDAP33 + pr50 + rc50 + j50, data = data2)

iv13 <- ivreg(RR_E13 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv14 <- ivreg(RR_E14 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv17 <- ivreg(RR_E17 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

iv19 <- ivreg(RR_E19 ~ exp50 + lander + az + hdam + mrooms + pd39 + exp_dist + 
                NSDAP33 + pr50 + rc50 + j50|
                instrument + exp_dist + lander + az + hdam + mrooms + pd39 + 
                NSDAP33 + pr50 + rc50 + j50, data = data2)

fit69        <- coeftest(iv69, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit72        <- coeftest(iv72, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit76        <- coeftest(iv76, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit83        <- coeftest(iv83, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit84        <- coeftest(iv84, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit87        <- coeftest(iv87, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit89        <- coeftest(iv89, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit90        <- coeftest(iv90, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit94a        <- coeftest(iv94a, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit94b        <- coeftest(iv94b, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit98        <- coeftest(iv98, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit99        <- coeftest(iv99, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit02        <- coeftest(iv02, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit04        <- coeftest(iv04, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit05        <- coeftest(iv05, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit09a        <- coeftest(iv09a, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit09b        <- coeftest(iv09b, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit13        <- coeftest(iv13, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit14        <- coeftest(iv14, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit17        <- coeftest(iv17, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))
fit19        <- coeftest(iv19, function(x) vcovCR(x, type="CR1S",cluster = data2$lander))

gaze.coeft <- function(x, col="Std. Error"){
  stopifnot(is.list(x))
  out <- lapply(x, function(y){
    y[ , col]
  })
  return(out)
}

stargazer(iv69,iv72,iv76,iv83,iv84,iv87,iv89, 
          se = gaze.coeft(list(fit69,fit72,fit76,fit83,fit84,fit87,fit89)),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(iv90,iv94a,iv94b,iv98,iv99,iv02,iv04, 
          se = gaze.coeft(list(fit90,fit94a,fit94b,fit98,fit99,fit02,fit04)),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(iv05,iv09a,iv09b,iv13,iv14,iv17,iv19, 
          se = gaze.coeft(list(fit05,fit09a,fit09b,fit13,fit14,fit17,fit19)),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(iv69,iv72,iv76,iv83,iv84,iv87,iv89,iv90,iv94a,iv94b,iv98,iv99,iv02,iv04,iv05,
   iv09a,iv09b,iv13,iv14,iv17,iv19,fit69,fit72,fit76,fit83,fit84,fit87,fit89,fit90,
   fit94a,fit94b,fit98,fit99,fit02,fit04,fit05,fit09a,fit09b,fit13,fit14,fit17,
   fit19,data2,gaze.coeft)

################################################################################
# Table C12: Additional control - Distance to nearest of 10 concentration camps
# See Homola et al. APSR 2020 for details of camps
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50","ccdist")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C13: Additional control - NSDAP vote share in 1928
################################################################################

controls <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50", "NSDAP28")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C14: Independent variable - expellee share in 1960
################################################################################

controls <- c("exp60","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)


stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp60"),
          covariate.labels = c("Share of Expellees -- 1960"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp60"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp60"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table C15: Additional controls - socioeconomic factors
################################################################################

cc <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
        "NSDAP33", "pr50", "rc50", "j50","t_typ")

c1998 <- c("UR98")
c1999 <- c("UR99")
c2002 <- c("GDP02","UR02","lI02")
c2004 <- c("GDP04","UR04","lI04")
c2005 <- c("GDP05","UR05","lI05")
c2009 <- c("GDP09","UR09","lI09")
c2013 <- c("GDP13","UR13","lI13")
c2014 <- c("GDP14","UR14","lI14","FS14")
c2017 <- c("lI14")

EL98 <- lm(paste('RR_E98', paste(c(cc,c1998), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(cc,c1999), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(cc,c2002), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(cc,c2004), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(cc,c2005), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(cc,c2009), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(cc,c2009), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(cc,c2013), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(cc,c2014), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(cc,c2017), collapse="+"), sep="~"), data = data)

ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 

stargazer(EL98,EL99,EL02,EL04,EL05,
          se = starprep(EL98,EL99,EL02,EL04,EL05, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL98,EL99,EL02,EL04,EL05, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES98$coefficients[2,1],2),round(ES99$coefficients[2,1],2),
                             round(ES02$coefficients[2,1],2),round(ES04$coefficients[2,1],2),
                             round(ES05$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1998}","\\textbf{1999}","\\textbf{2002}","\\textbf{2004}",
                             "\\textbf{2005}"),
          column.labels = c("","","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL09a,EL09b,EL13,EL14,EL17,
          se = starprep(EL09a,EL09b,EL13,EL14,EL17, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL09a,EL09b,EL13,EL14,EL17, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES09a$coefficients[2,1],2),round(ES09b$coefficients[2,1],2),
                             round(ES13$coefficients[2,1],2),round(ES14$coefficients[2,1],2),
                             round(ES17$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2009}","\\textbf{2009}","\\textbf{2013}","\\textbf{2014}",
                             "\\textbf{2017}"),
          column.labels = c("","","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL98,EL99,EL02,EL04,EL05,EL09a,EL09b,EL13,EL14,EL17,
   ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,
   c1998,c1999,c2002,c2004,c2005,c2009,c2013,c2014,c2017,cc)

################################################################################
# Table C16: Dependent variable - unemployment rate
################################################################################

cc <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
        "NSDAP33", "pr50", "rc50", "j50")

U98 <- lm(paste('UR98', paste(c(cc), collapse="+"), sep="~"), data = data)
U99 <- lm(paste('UR99', paste(c(cc), collapse="+"), sep="~"), data = data)
U02 <- lm(paste('UR02', paste(c(cc), collapse="+"), sep="~"), data = data)
U04 <- lm(paste('UR04', paste(c(cc), collapse="+"), sep="~"), data = data)
U05 <- lm(paste('UR05', paste(c(cc), collapse="+"), sep="~"), data = data)
U09 <- lm(paste('UR09', paste(c(cc), collapse="+"), sep="~"), data = data)
U13 <- lm(paste('UR13', paste(c(cc), collapse="+"), sep="~"), data = data)
U14 <- lm(paste('UR14', paste(c(cc), collapse="+"), sep="~"), data = data)

ES98 <- reghelper::beta(U98); ES99 <- reghelper::beta(U99); ES02 <- reghelper::beta(U02) 
ES04 <- reghelper::beta(U04); ES05 <- reghelper::beta(U05); ES09 <- reghelper::beta(U09)
ES13 <- reghelper::beta(U13); ES14 <- reghelper::beta(U14)

stargazer(U98,U99,U02,U04,U05,U09,U13,U14,
          se = starprep(U98,U99,U02,U04,U05,U09,U13,U14, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(U98,U99,U02,U04,U05,U09,U13,U14, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta",
                             round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),
                             round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2),
                             round(ES05$coefficients[2,1],2),
                             round(ES09$coefficients[2,1],2),
                             round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1998}","\\textbf{1999}","\\textbf{2002}","\\textbf{2004}",
                             "\\textbf{2005}","\\textbf{2009}","\\textbf{2013}","\\textbf{2014}"),
          column.labels = c("","","","",
                            "","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(U98,U99,U02,U04,U05,U09,U13,U14,
   ES98,ES99,ES02,ES04,ES05,ES09,ES13,ES14,cc)

################################################################################
# Table C17: Dependent variable - household income
################################################################################

cc <- c("exp50","lander","az","hdam","mrooms","pd39","exp_dist",
        "NSDAP33", "pr50", "rc50", "j50")

I02 <- lm(paste('lI02', paste(c(cc), collapse="+"), sep="~"), data = data)
I04 <- lm(paste('lI04', paste(c(cc), collapse="+"), sep="~"), data = data)
I05 <- lm(paste('lI05', paste(c(cc), collapse="+"), sep="~"), data = data)
I09 <- lm(paste('lI09', paste(c(cc), collapse="+"), sep="~"), data = data)
I13 <- lm(paste('lI13', paste(c(cc), collapse="+"), sep="~"), data = data)
I14 <- lm(paste('lI14', paste(c(cc), collapse="+"), sep="~"), data = data)
I17 <- lm(paste('lI17', paste(c(cc), collapse="+"), sep="~"), data = data)

ES02 <- reghelper::beta(I02)
ES04 <- reghelper::beta(I04); ES05 <- reghelper::beta(I05); ES09 <- reghelper::beta(I09)
ES13 <- reghelper::beta(I13); ES14 <- reghelper::beta(I14); ES17 <- reghelper::beta(I17)

stargazer(I02,I04,I05,I09,I13,I14,I17,
          se = starprep(I02,I04,I05,I09,I13,I14,I17, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(I02,I04,I05,I09,I13,I14,I17, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta",
                             round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2),
                             round(ES05$coefficients[2,1],2),
                             round(ES09$coefficients[2,1],2),
                             round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),
                             round(ES17$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2002}","\\textbf{2004}","\\textbf{2005}",
                             "\\textbf{2009}","\\textbf{2013}","\\textbf{2014}","\\textbf{2017}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(I02,I04,I05,I09,I13,I14,I17,
  ES02,ES04,ES05,ES09,ES13,ES14,ES17,cc)

################################################################################
# Table D1: Association between expellee share and monument presence
################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33","pr50","rc50","j50")

EL69 <- glm(paste('mpresence_1969', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL72 <- glm(paste('mpresence_1972', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL76 <- glm(paste('mpresence_1976', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL83 <- glm(paste('mpresence_1983', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL84 <- glm(paste('mpresence_1984', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL87 <- glm(paste('mpresence_1987', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL89 <- glm(paste('mpresence_1989', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL90 <- glm(paste('mpresence_1990', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL94 <- glm(paste('mpresence_1994', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL98 <- glm(paste('mpresence_1998', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL99 <- glm(paste('mpresence_1999', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL02 <- glm(paste('mpresence_2002', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL04 <- glm(paste('mpresence_2004', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL05 <- glm(paste('mpresence_2005', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL09 <- glm(paste('mpresence_2009', paste(c('exp50',controls), collapse="+"), sep="~"),family="binomial",data = data)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}","\\textbf{1990}"),
          column.labels = c("","","","","","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL94,EL98,EL99,EL02,EL04,EL05,EL09, 
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1994}","\\textbf{1998}","\\textbf{1999}",
                             "\\textbf{2002}","\\textbf{2004}","\\textbf{2005}","\\textbf{2009}"),
          column.labels = c("","","","","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94,EL98,EL99,EL02,EL04,EL05,
   EL09,controls)

################################################################################
# Table D2: Association between expellee share and monument count
################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33","pr50","rc50","j50")

EL69 <- glm(paste('mnum_1969', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL72 <- glm(paste('mnum_1972', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL76 <- glm(paste('mnum_1976', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL83 <- glm(paste('mnum_1983', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL84 <- glm(paste('mnum_1984', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL87 <- glm(paste('mnum_1987', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL89 <- glm(paste('mnum_1989', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL90 <- glm(paste('mnum_1990', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL94 <- glm(paste('mnum_1994', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL98 <- glm(paste('mnum_1998', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL99 <- glm(paste('mnum_1999', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL02 <- glm(paste('mnum_2002', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL04 <- glm(paste('mnum_2004', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL05 <- glm(paste('mnum_2005', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL09 <- glm(paste('mnum_2009', paste(c('exp50',controls), collapse="+"), sep="~"),family="poisson",data = data)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}","\\textbf{1990}"),
          column.labels = c("","","","","","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL94,EL98,EL99,EL02,EL04,EL05,EL09, 
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1994}","\\textbf{1998}","\\textbf{1999}",
                             "\\textbf{2002}","\\textbf{2004}","\\textbf{2005}","\\textbf{2009}"),
          column.labels = c("","","","","","",""),
          keep = c("exp50"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94,EL98,EL99,EL02,EL04,EL05,
   EL09,controls)

################################################################################
# Table D3: Association between monument presence and radical right vote
################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33","pr50","rc50","j50")

EL69 <- lm(paste('RR_E69', paste(c('mpresence_1969',controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c('mpresence_1972',controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c('mpresence_1976',controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c('mpresence_1983',controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c('mpresence_1984',controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c('mpresence_1987',controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c('mpresence_1989',controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c('mpresence_1990',controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c('mpresence_1994',controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c('mpresence_1994',controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c('mpresence_1998',controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c('mpresence_1999',controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c('mpresence_2002',controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c('mpresence_2004',controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c('mpresence_2005',controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c('mpresence_2009',controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c('mpresence_2009',controls), collapse="+"), sep="~"), data = data)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89,clusters = data$lander,se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89,clusters = data$lander,stat = "p.value",se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("mpresence_1969","mpresence_1972","mpresence_1976","mpresence_1983",
                   "mpresence_1984","mpresence_1987","mpresence_1989"),
          covariate.labels = c("Presence of monuments","Presence of monuments","Presence of monuments",
                               "Presence of monuments","Presence of monuments","Presence of monuments",
                               "Presence of monuments"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se= starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,clusters = data$lander,se_type = "stata"),
          p= starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,clusters = data$lander,stat = "p.value",se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("mpresence_1990","mpresence_1994","mpresence_1998","mpresence_1999",
                   "mpresence_2002","mpresence_2004"),
          covariate.labels = c("Presence of monuments","Presence of monuments","Presence of monuments",
                               "Presence of monuments","Presence of monuments","Presence of monuments"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,
          se = starprep(EL05,EL09a,EL09b, clusters = data$lander,se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b, clusters = data$lander,stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}"),
          column.labels = c("","",""),
          keep = c("mpresence_2005","mpresence_2009"),
          covariate.labels = c("Presence of monuments","Presence of monuments"),
          star.cutoffs = c(.1,0.05,0.01,.001),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,controls)

################################################################################
# Table D4:  Association between monument count and radical right vote
################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33","pr50","rc50","j50")

EL69 <- lm(paste('RR_E69', paste(c('mnum_1969',controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c('mnum_1972',controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c('mnum_1976',controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c('mnum_1983',controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c('mnum_1984',controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c('mnum_1987',controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c('mnum_1989',controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c('mnum_1990',controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c('mnum_1994',controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c('mnum_1994',controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c('mnum_1998',controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c('mnum_1999',controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c('mnum_2002',controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c('mnum_2004',controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c('mnum_2005',controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c('mnum_2009',controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c('mnum_2009',controls), collapse="+"), sep="~"), data = data)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander,se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander,stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",dep.var.caption = (""),model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("mnum_1969","mnum_1972","mnum_1976","mnum_1983",
                   "mnum_1984","mnum_1987","mnum_1989"),
          covariate.labels = c("Presence of monuments","Presence of monuments","Presence of monuments",
                               "Presence of monuments","Presence of monuments","Presence of monuments",
                               "Presence of monuments"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",dep.var.caption = (""),model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("mnum_1990","mnum_1994","mnum_1998","mnum_1999",
                   "mnum_2002","mnum_2004"),
          covariate.labels = c("Presence of monuments","Presence of monuments","Presence of monuments",
                               "Presence of monuments","Presence of monuments","Presence of monuments"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,
          se = starprep(EL05,EL09a,EL09b, clusters = data$lander,se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b, clusters = data$lander,stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",dep.var.caption = (""),model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}"),
          column.labels = c("","",""),
          keep = c("mnum_2005","mnum_2009"),
          covariate.labels = c("Presence of monuments","Presence of monuments"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,controls)

################################################################################
# Table D5: Association between expellee share and association prescence presence
################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33","pr50","rc50","j50")

AEXP <- glm(paste('association', paste(c('exp50',controls), collapse="+"), sep="~"),
            family="binomial",data = associations_data)

AEXP2 <- glm(paste('association', paste(c('vk_exp','er_exp',
                                          controls), collapse="+"), 
                   sep="~"),family="binomial",data = associations_data)

stargazer(AEXP,AEXP2, 
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",dep.var.caption = (""),model.numbers = FALSE,
          dep.var.labels = c("",""),
          column.labels = c("",""),
          keep = c("exp50","vk_exp","er_exp"),
          covariate.labels = c("Share of Expellees -- 1950",
                               "Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",omit.table.layout = "n")

rm(AEXP,AEXP2,controls)

################################################################################
# Table D6: Association between association presence and radical right vote
################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33","pr50","rc50","j50")

EL69 <- lm(paste('RR_E69', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL72 <- lm(paste('RR_E72', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL76 <- lm(paste('RR_E76', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL83 <- lm(paste('RR_E83', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL84 <- lm(paste('RR_E84', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL87 <- lm(paste('RR_E87', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL89 <- lm(paste('RR_E89', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL90 <- lm(paste('RR_E90', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL94a <- lm(paste('RR_E94a', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL94b <- lm(paste('RR_E94b', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL98 <- lm(paste('RR_E98', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL99 <- lm(paste('RR_E99', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL02 <- lm(paste('RR_E02', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL04 <- lm(paste('RR_E04', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL05 <- lm(paste('RR_E05', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL09a <- lm(paste('RR_E09a', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL09b <- lm(paste('RR_E09b', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL13 <- lm(paste('RR_E13', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL14 <- lm(paste('RR_E14', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL17 <- lm(paste('RR_E17', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)
EL19 <- lm(paste('RR_E19', paste(c('association',controls), collapse="+"), sep="~"), data = associations_data)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = associations_data$lander,
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = associations_data$lander,stat = "p.value", 
                       se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",dep.var.caption = (""),model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("association"),
          covariate.labels = c("Presence of expellee association"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = associations_data$lander,
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = associations_data$lander,
                       stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",dep.var.caption = (""),model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("association"),
          covariate.labels = c("Presence of expellee association"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19,
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = associations_data$lander,
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = associations_data$lander,
                       stat = "p.value", se_type = "stata"),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",dep.var.caption = (""),model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}",
                             "\\textbf{2013}","\\textbf{2014}","\\textbf{2017}",
                             "\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("association"),
          covariate.labels = c("Presence of expellee association"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,controls)

################################################################################
# Table D7: Turnout
################################################################################

controls <- c("exp60","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('t69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('t72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('t76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('t83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('t84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('t87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('t89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('t90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('t94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('t94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('t98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('t99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('t02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('t04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('t05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('t09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('t09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('t13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('t14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('t17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('t19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp60"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander,
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp60"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("exp60"),
          covariate.labels = c("Share of Expellees -- 1950"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)

################################################################################
# Table D8:  Association between subgroup shares and monument presence
################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- glm(paste('mpresence_1969', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL72 <- glm(paste('mpresence_1972', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL76 <- glm(paste('mpresence_1976', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL83 <- glm(paste('mpresence_1983', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL84 <- glm(paste('mpresence_1984', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL87 <- glm(paste('mpresence_1987', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL89 <- glm(paste('mpresence_1989', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL90 <- glm(paste('mpresence_1990', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL94 <- glm(paste('mpresence_1994', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL98 <- glm(paste('mpresence_1998', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL99 <- glm(paste('mpresence_1999', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL02 <- glm(paste('mpresence_2002', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL04 <- glm(paste('mpresence_2004', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL05 <- glm(paste('mpresence_2005', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)
EL09 <- glm(paste('mpresence_2009', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="binomial",data = data)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}","\\textbf{1990}"),
          column.labels = c("","","","","","","",""),
          keep = c("vk_exp","er_exp"),
          covariate.labels = c("Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL94,EL98,EL99,EL02,EL04,EL05,EL09, 
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1994}","\\textbf{1998}","\\textbf{1999}",
                             "\\textbf{2002}","\\textbf{2004}","\\textbf{2005}","\\textbf{2009}"),
          column.labels = c("","","","","","",""),
          keep = c("vk_exp","er_exp"),
          covariate.labels = c("Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94,EL98,EL99,EL02,EL04,EL05,
   EL09,EL13,EL14,EL17,EL19,controls)

##############################################################################################################
# Table D9: Association between subgroup shares and monument count
##############################################################################################################

controls <- c("lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- glm(paste('mnum_1969', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL72 <- glm(paste('mnum_1972', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL76 <- glm(paste('mnum_1976', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL83 <- glm(paste('mnum_1983', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL84 <- glm(paste('mnum_1984', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL87 <- glm(paste('mnum_1987', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL89 <- glm(paste('mnum_1989', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL90 <- glm(paste('mnum_1990', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL94 <- glm(paste('mnum_1994', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL98 <- glm(paste('mnum_1998', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL99 <- glm(paste('mnum_1999', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL02 <- glm(paste('mnum_2002', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL04 <- glm(paste('mnum_2004', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL05 <- glm(paste('mnum_2005', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)
EL09 <- glm(paste('mnum_2009', paste(c('vk_exp','er_exp',controls), collapse="+"), sep="~"),family="poisson",data = data)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}","\\textbf{1990}"),
          column.labels = c("","","","","","","",""),
          keep = c("vk_exp","er_exp"),
          covariate.labels = c("Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL94,EL98,EL99,EL02,EL04,EL05,EL09, 
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1994}","\\textbf{1998}","\\textbf{1999}",
                             "\\textbf{2002}","\\textbf{2004}","\\textbf{2005}","\\textbf{2009}"),
          column.labels = c("","","","","","",""),
          keep = c("vk_exp","er_exp"),
          covariate.labels = c("Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94,EL98,EL99,EL02,EL04,EL05,
   EL09,EL13,EL14,EL17,EL19,controls)

################################################################################
# Table D10: Sub-group analysis
################################################################################

controls <- c("vk_exp","er_exp","lander","az","hdam","mrooms","pd39","exp_dist",
              "NSDAP33", "pr50", "rc50", "j50")

EL69 <- lm(paste('RR_E69', paste(c(controls), collapse="+"), sep="~"), data = data)
EL72 <- lm(paste('RR_E72', paste(c(controls), collapse="+"), sep="~"), data = data)
EL76 <- lm(paste('RR_E76', paste(c(controls), collapse="+"), sep="~"), data = data)
EL83 <- lm(paste('RR_E83', paste(c(controls), collapse="+"), sep="~"), data = data)
EL84 <- lm(paste('RR_E84', paste(c(controls), collapse="+"), sep="~"), data = data)
EL87 <- lm(paste('RR_E87', paste(c(controls), collapse="+"), sep="~"), data = data)
EL89 <- lm(paste('RR_E89', paste(c(controls), collapse="+"), sep="~"), data = data)
EL90 <- lm(paste('RR_E90', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94a <- lm(paste('RR_E94a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL94b <- lm(paste('RR_E94b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL98 <- lm(paste('RR_E98', paste(c(controls), collapse="+"), sep="~"), data = data)
EL99 <- lm(paste('RR_E99', paste(c(controls), collapse="+"), sep="~"), data = data)
EL02 <- lm(paste('RR_E02', paste(c(controls), collapse="+"), sep="~"), data = data)
EL04 <- lm(paste('RR_E04', paste(c(controls), collapse="+"), sep="~"), data = data)
EL05 <- lm(paste('RR_E05', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09a <- lm(paste('RR_E09a', paste(c(controls), collapse="+"), sep="~"), data = data)
EL09b <- lm(paste('RR_E09b', paste(c(controls), collapse="+"), sep="~"), data = data)
EL13 <- lm(paste('RR_E13', paste(c(controls), collapse="+"), sep="~"), data = data)
EL14 <- lm(paste('RR_E14', paste(c(controls), collapse="+"), sep="~"), data = data)
EL17 <- lm(paste('RR_E17', paste(c(controls), collapse="+"), sep="~"), data = data)
EL19 <- lm(paste('RR_E19', paste(c(controls), collapse="+"), sep="~"), data = data)

ES69 <- reghelper::beta(EL69); ES72 <- reghelper::beta(EL72); ES76 <- reghelper::beta(EL76)
ES83 <- reghelper::beta(EL83); ES84 <- reghelper::beta(EL84); ES87 <- reghelper::beta(EL87)
ES89 <- reghelper::beta(EL89); ES90 <- reghelper::beta(EL90); ES94a <- reghelper::beta(EL94a)
ES94b <- reghelper::beta(EL94b); ES09b <- reghelper::beta(EL09b)
ES98 <- reghelper::beta(EL98); ES99 <- reghelper::beta(EL99); ES02 <- reghelper::beta(EL02) 
ES04 <- reghelper::beta(EL04); ES05 <- reghelper::beta(EL05); ES09a <- reghelper::beta(EL09a)
ES13 <- reghelper::beta(EL13); ES14 <- reghelper::beta(EL14); ES17 <- reghelper::beta(EL17) 
ES19 <- reghelper::beta(EL19); ES94a <- reghelper::beta(EL94a)

stargazer(EL69,EL72,EL76,EL83,EL84,EL87,EL89, 
          se = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL69,EL72,EL76,EL83,EL84,EL87,EL89, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta -- Volks", 
                             round(ES69$coefficients[2,1],2),round(ES72$coefficients[2,1],2),
                             round(ES76$coefficients[2,1],2),round(ES83$coefficients[2,1],2),
                             round(ES84$coefficients[2,1],2),round(ES87$coefficients[2,1],2),
                             round(ES89$coefficients[2,1],2)),
                           c("Standardized beta -- Reichs", 
                             round(ES69$coefficients[3,1],2),round(ES72$coefficients[3,1],2),
                             round(ES76$coefficients[3,1],2),round(ES83$coefficients[3,1],2),
                             round(ES84$coefficients[3,1],2),round(ES87$coefficients[3,1],2),
                             round(ES89$coefficients[3,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1969}","\\textbf{1972}","\\textbf{1976}","\\textbf{1983}",
                             "\\textbf{1984}","\\textbf{1987}","\\textbf{1989}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("vk_exp","er_exp"),
          covariate.labels = c("Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, 
          se = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL90,EL94a,EL94b,EL98,EL99,EL02,EL04, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta -- Volks", 
                             round(ES90$coefficients[2,1],2),round(ES94a$coefficients[2,1],2),
                             round(ES94b$coefficients[2,1],2),round(ES98$coefficients[2,1],2),
                             round(ES99$coefficients[2,1],2),round(ES02$coefficients[2,1],2),
                             round(ES04$coefficients[2,1],2)),
                           c("Standardized beta -- Reichs", 
                             round(ES90$coefficients[3,1],2),round(ES94a$coefficients[3,1],2),
                             round(ES94b$coefficients[3,1],2),round(ES98$coefficients[3,1],2),
                             round(ES99$coefficients[3,1],2),round(ES02$coefficients[3,1],2),
                             round(ES04$coefficients[3,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{1990}","\\textbf{1994}","\\textbf{1994}","\\textbf{1998}",
                             "\\textbf{1999}","\\textbf{2002}","\\textbf{2004}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("vk_exp","er_exp"),
          covariate.labels = c("Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

stargazer(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, 
          se = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                        se_type = "stata"),
          p = starprep(EL05,EL09a,EL09b,EL13,EL14,EL17,EL19, clusters = data$lander, 
                       stat = "p.value", se_type = "stata"),
          add.lines = list(c("Standardized beta -- Volks", 
                             round(ES05$coefficients[2,1],2),round(ES09a$coefficients[2,1],2),
                             round(ES09b$coefficients[2,1],2),round(ES13$coefficients[2,1],2),
                             round(ES14$coefficients[2,1],2),round(ES17$coefficients[2,1],2),
                             round(ES19$coefficients[2,1],2)),
                           c("Standardized beta -- Reichs", 
                             round(ES05$coefficients[3,1],2),round(ES09a$coefficients[3,1],2),
                             round(ES09b$coefficients[3,1],2),round(ES13$coefficients[3,1],2),
                             round(ES14$coefficients[3,1],2),round(ES17$coefficients[3,1],2),
                             round(ES19$coefficients[3,1],2))),
          no.space = FALSE, keep.stat = "n",
          omit = "Constant",
          dep.var.caption = (""),
          model.numbers = FALSE,
          dep.var.labels = c("\\textbf{2005}","\\textbf{2009}","\\textbf{2009}","\\textbf{2013}",
                             "\\textbf{2014}","\\textbf{2017}","\\textbf{2019}"),
          column.labels = c("","","","",
                            "","",""),
          keep = c("vk_exp","er_exp"),
          covariate.labels = c("Share Volksdeutsche","Share Reichsdeutsche"),
          star.cutoffs = c(.1,0.05,0.01),
          notes.label = "",
          omit.table.layout = "n")

rm(EL69,EL72,EL76,EL83,EL84,EL87,EL89,EL90,EL94a,EL94b,EL98,EL99,EL02,EL04,EL05,
   EL09a,EL09b,EL13,EL14,EL17,EL19,ES69,ES72,ES76,ES83,ES84,ES87,ES89,ES90,
   ES94a,ES94b,ES98,ES99,ES02,ES04,ES05,ES09a,ES09b,ES13,ES14,ES17,ES19,controls)